package com.waymap.controller;

import com.waymap.common.Constant;
import com.waymap.utils.mq.MsgProducer;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created by tim on 2018/7/27.
 * 测试控制器类
 */
@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private MsgProducer producer;


    @RequestMapping(value = "/wmsQueue", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public String wmsQueue(){
        javax.jms.Destination destination = new ActiveMQQueue(Constant.Queue_Name);
        producer.sendMessage(destination, "test queue..... ");
        return "测试队列成功";
    }
}
